package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@TableName("pm_material_item")
@ApiModel(value = "PmMaterialItem对象", description = "项目物料清单条目明细表（含确认/分组）")
public class PmMaterialItem {


    @ApiModelProperty(value = "条目ID（自增主键）", example = "1")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "关联物料清单ID（关联pm_material_list.id）", required = true, example = "1")
    @TableField("list_id")
    private Long listId;

    @ApiModelProperty(value = "序号", required = true, example = "1")
    @TableField("sort_no")
    private Integer sortNo;

    @ApiModelProperty(value = "材料名称", required = true, example = "实木地板")
    @TableField("material_name")
    private String materialName;

    @ApiModelProperty(value = "规格", example = "橡木-浅灰色-XX品牌")
    @TableField("spec")
    private String spec;

    @ApiModelProperty(value = "使用单位", allowableValues = "1,2,3,4,5",
            notes = "1=平方，2=投影，3=米，4=项，5=组", example = "1")
    @TableField("use_unit")
    private Integer useUnit;

    @ApiModelProperty(value = "材料用量", example = "100.50")
    @TableField("material_quantity")
    private BigDecimal materialQuantity;

    @ApiModelProperty(value = "用户查看价格（元/单位）", example = "280.00")
    @TableField("user_view_price")
    private BigDecimal userViewPrice;

    @ApiModelProperty(value = "用户总价（元）", example = "28140.00")
    @TableField("user_total_price")
    private BigDecimal userTotalPrice;

    @ApiModelProperty(value = "成本价格（元/单位）", example = "200.00")
    @TableField("cost_price")
    private BigDecimal costPrice;

    @ApiModelProperty(value = "成本总价（元）", example = "20100.00")
    @TableField("cost_total_price")
    private BigDecimal costTotalPrice;

    @ApiModelProperty(value = "渠道商", example = "XX建材供应商")
    @TableField("supplier")
    private String supplier;

    @ApiModelProperty(value = "工艺说明", example = "自流平地面+锁扣安装")
    @TableField("tech_desc")
    private String techDesc;

    @ApiModelProperty(value = "图片URL", example = "https://xxx.com/floor.jpg")
    @TableField("material_img")
    private String materialImg;

    @ApiModelProperty(value = "产地", example = "广东佛山")
    @TableField("production_place")
    private String productionPlace;

    @ApiModelProperty(value = "物料分类", allowableValues = "1,2,3,4,5,6",
            notes = "1=主材，2=辅材，3=家具软装，4=厨卫定制，5=全屋家具定制，6=工程项目", example = "1")
    @TableField("material_category")
    private Integer materialCategory;

    @ApiModelProperty(value = "初始预算类别", allowableValues = "1,2,3",
            notes = "1=基础项，2=升级项，3=增项", example = "1")
    @TableField("budget_type")
    private Integer budgetType;

    @ApiModelProperty(value = "预算类别确认状态", allowableValues = "0,1",
            notes = "0=未确认，1=已确认", example = "0")
    @TableField("is_budget_confirmed")
    private Integer isBudgetConfirmed;

    @ApiModelProperty(value = "最终预算类别（确认后生效）", allowableValues = "1,2,3",
            notes = "未确认时为NULL", example = "1")
    @TableField("final_budget_type")
    private Integer finalBudgetType;

    @ApiModelProperty(value = "预算分组ID（同物料多配置归为一组）", example = "f81d4fae-7dec-11d0-a785-00a4fc33085")
    @TableField("budget_group_id")
    private String budgetGroupId;

    @ApiModelProperty(value = "预算分组名称", example = "地板配置选项")
    @TableField("budget_group_name")
    private String budgetGroupName;

    @ApiModelProperty(value = "使用空间", allowableValues = "1,2,3,4,5,6,7,8,9", example = "1")
    @TableField("use_space")
    private Integer useSpace;

    @ApiModelProperty(value = "是否自购", allowableValues = "0,1", example = "0")
    @TableField("is_self_purchase")
    private Integer isSelfPurchase;

    @ApiModelProperty(value = "是否需要安装", allowableValues = "0,1", example = "1")
    @TableField("need_install")
    private Integer needInstall;

    @ApiModelProperty(value = "采购时间", example = "2025-10-01")
    @TableField("purchase_time")
    private Date purchaseTime;

    @ApiModelProperty(value = "选材备注", example = "业主指定品牌")
    @TableField("selection_remark")
    private String selectionRemark;

    @ApiModelProperty(value = "尺寸 长*宽*高", example = "870.00*270.03*2000.00")
    @TableField("size")
    private String size;

    /**
     * 逻辑删除标识：0-未删除，1-已删除
     */
    @TableField("deleted")
    @TableLogic
    private Integer deleted;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

}
